package cn.itcast.com.Annotation;

public class demo1 {
    public static void main(String[] args) {
        Student student = new Student(19);
        Student student1 = new Student(40);

    }
}

class Student {
    @AgeConstraint(minAge = 18,maxAge = 26)
    int age;

    public Student(int age) {
        this.age = age;
    }
}

class Teacher {
    @AgeConstraint(maxAge = 50, minAge = 25)
    int age;
}

@interface AgeConstraint{
    int minAge();
    int maxAge();
}